package com.zg.nacos.domain.vo;

import com.zg.common.core.vo.BaseVo;
import com.zg.common.core.vo.IVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;

/**
 * <p>Description: </p>
 *
 * @author zhanfeng.liang
 * @since 2025/6/23 20:17
 */

@ApiModel(description = "服务基本信息")
public class ServiceVo extends BaseVo {

    /** 服务名称 */
    @ApiModelProperty(value = "服务名称", example = "zg-apis", required = true)
    private String name;

    /** 服务组名称 */
    @ApiModelProperty(value = "服务组名称", example = "DEFAULT_GROUP", required = true)
    private String groupName;

    /** 保护阈值 */
    @ApiModelProperty(value = "保护阈值", example = "0.0", required = true)
    private double protectThreshold;

    /** 选择器 */
    @ApiModelProperty(value = "服务选择器", required = true)
    private SelectorVo selector;

    /** 元数据 */
    @ApiModelProperty(value = "服务元数据", required = true)
    private Map<String, String> metadata;

    private String namespaceId;

    // getter和setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public double getProtectThreshold() {
        return protectThreshold;
    }

    public void setProtectThreshold(double protectThreshold) {
        this.protectThreshold = protectThreshold;
    }

    public SelectorVo getSelector() {
        return selector;
    }

    public void setSelector(SelectorVo selector) {
        this.selector = selector;
    }

    public Map<String, String> getMetadata() {
        return metadata;
    }

    public void setMetadata(Map<String, String> metadata) {
        this.metadata = metadata;
    }

    public String getNamespaceId() {
        return namespaceId;
    }

    public void setNamespaceId(String namespaceId) {
        this.namespaceId = namespaceId;
    }

    @Override
    public String toString() {
        return "ServiceVO{" +
                "name='" + name + '\'' +
                ", groupName='" + groupName + '\'' +
                ", protectThreshold=" + protectThreshold +
                ", selector=" + selector +
                ", metadata=" + metadata +
                '}';
    }
}
